package model

import "gorm.io/gorm"

// 用户

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(32)"`
}

// 用户角色

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int"`
	Rid int `gorm:"type:int"`
}

// 角色

type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(30)"`
}

// 角色权限

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int"`
	Nid int `gorm:"type:int"`
}

// 权限

type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(30)"`
}

// 商品

type Shop struct {
	gorm.Model
	ShopCode string `gorm:"type:varchar(30)"`
	ShopName string `gorm:"type:varchar(30)"`
}

// 订单

type Order struct {
	gorm.Model
	OrderCode string `gorm:"type:varchar(30)"`
	OrderName string `gorm:"type:varchar(30)"`
	Sid       int    `gorm:"type:int"`
}

// 商品订单列表

type ShopOrderList struct {
	OrderId   int
	OrderCode string
	OrderName string
	ShopCode  string
	ShopName  string
}
